package fzu.functiongather.DrawerMenu;


import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import fzu.functiongather.Adapter.DrawerMenuAdapter;
import fzu.functiongather.BaseActivity;
import fzu.functiongather.R;


/**
 * Created by RuiyuHuang on 2016/7/15 0015.
 */
public class DrawerMenuActivity extends BaseActivity implements AdapterView.OnItemClickListener {

    private FragmentContent mfragmentContent;
    private DrawerLayout mdrawerLayout;
    private ListView mdrawerMenuListView;
    private List<String> mdrawerMemuLists;
    private DrawerMenuAdapter mdrawerMemuadapter;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.drawer_menu);
        initView();
        initData();
    }

    /**
     * 初始化布局
     */
    private void initView() {
        mdrawerMemuLists = new ArrayList<String>();
        mfragmentContent = new FragmentContent();
        mdrawerMemuadapter = new DrawerMenuAdapter(mdrawerMemuLists,DrawerMenuActivity.this);
        mdrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        mdrawerMenuListView = (ListView) findViewById(R.id.left_drawer);
        mdrawerMenuListView.setAdapter(mdrawerMemuadapter);

    }

    /**
     * 初始化数据
     */
    private void initData() {
        mdrawerMemuLists.add("第一行");
        mdrawerMemuLists.add("第二行");
        mdrawerMemuLists.add("第三行");
        mdrawerMemuLists.add("第四行");
        mdrawerMemuLists.add("第五行");
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

    }
}
